﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using PaliTextReader2.Utilities;

namespace PaliTextReader2
{
    public partial class BookmarkNameDlg : Form
    {
        public BookmarkNameDlg()
        {
            InitializeComponent();
        }

        public string BookmarkName
        {
            get
            {
                return ctlBookmarkName.Text;
            }
            set
            {
                ctlBookmarkName.Text = value;
            }
        }

        private void ctlBookmarkName_Validating(object sender, CancelEventArgs e)
        {
            if (ctlBookmarkName.Text.Trim() == String.Empty)
            {
                ctlError.SetError(ctlBookmarkName, "name required");
                e.Cancel = true;
            }
            else
                ctlError.SetError(ctlBookmarkName, "");
        }

        private void ctlBookmarkName_KeyDown(object sender, KeyEventArgs e)
        {
            PaliKeyboard.HandlePaliKeys(ctlBookmarkName, e);
        }
    }
}
